<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@page import="it.milanoeasy.gae.User"%>
<%@page import="com.google.appengine.api.users.UserService"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	</head>	
	<body>
	<%
		UserService userService = null;
		try {
			userService = UserServiceFactory.getUserService();
		} catch(Exception e){
			System.out.println("Error: "+e.getMessage());
		}
		User user=(User)request.getAttribute("user");
	%>
		<p>Hello, <%= user.getNickname()%></p>
		<table>
			<tr>
				<td>Nickname</td>
				<td><%= user.getNickname()%></td>
			</tr>
			<tr>
				<td>UserId</td>
				<td><%= user.getUserId()%></td>
			</tr>
			<tr>
				<td>Email</td>
				<td><%= user.getEmail()%></td>
			</tr>
			<tr>
				<td>AuthDomain</td>
				<td><%= user.getAuthDomain()%></td>
			</tr>			
			<tr>
				<td>FederatedIdentity</td>
				<td><%= user.getFederatedIdentity()%></td>
			</tr>						
		</table>
		<% if (userService!=null) {%>
		<!-- <a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">logout</a>  -->
		<a href="_ah/logout?continue=%2Fuser">logout</a>
		<%} %>
	</body>
	</html>